import HttpHandler from "@/handler/HttpHandler";

export default class  {
  constructor() {
    this.http = new HttpHandler();
  }

  // 获取分组树结构
  groupTreeData(data) {
    let url = '/tie-demo/equipment/queryGroupTree';
    return this.http.get(url, data);
  }

  //获取类别列表
  queryGroupTree(data){
    let url='/tie-demo/equipment/queryGroupTree';
    return this.http.get(url,data)
  }

  //左树添加
  add(data){
    let url='/tie-demo/equipment/add';
    return this.http.post(url,data)
  }

  //左树编辑
  detailTree(data){
    let url='/tie-demo/equipment/detail';
    return this.http.get(url,data)
  }
  //左树修改
  update(data){
    let url='/tie-demo/equipment/update';
    return this.http.post(url,data)
  }

  //左树删除
  delete(data){
    let url='/tie-demo/equipment/delete';
    return this.http.get(url,data)
  }

  //分页查询
  queryListPage(data){
    let url='/tie-demo/equipment/queryListPage';
    return this.http.get(url,data)
  }

  //-- 设备资料 --

  //设备详情
  detail(data){
    let url='/tie-demo/equipment/facilityDetail';
    return this.http.get(url,data)
  }

  //车间
 queryFactoryList(data){
    let url='/tie-system/entDept/queryFactoryList';
    return this.http.get(url,data)
  }

 //设备编辑
  //新增
  addFacility(data){
    let url='/tie-demo/equipment/addFacility';
    return this.http.post(url,data)
  }

  //修改
  updateFacility(data){
    let url='/tie-demo/equipment/updateFacility';
    return this.http.post(url,data)
  }

  // 获取系统枚举
  getEnum(params) {
    let url = "/tie-system/resource/getEnum";
    return this.http.get(url, params);
  }

  //主设备
  getFisMain(){
    let url='/tie-demo/equipment/getFisMain';
    return this.http.get(url,data)
  }

  //启用 禁用
  batchChangeState(data){
    let url='tie-demo/equipment/batchChangeState';
    return this.http.post(url,data)
  }

  //删除
  batchDelete(data){
    let url = '/tie-demo/equipment/batchDelete';
    return this.http.post(url,data)
  }

}
